package com.aruba.deptapi.web;

import com.aruba.bean.WDept;
import com.aruba.deptapi.webfeign.DeptFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class DeptController {
    @Autowired
    private DeptFeignClient deptFeignClient;

    @RequestMapping("/insertDept")
    public String insertDept(@RequestParam("deptId") Integer id) {
        return deptFeignClient.insertDept(new WDept(id, "Feign"));
    }

}
